package boot12.entity;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
public class ParamController {

    @RequestMapping("/param1")
    @ResponseBody
    public String param1(HttpServletRequest request){
        String s = request.getParameter("info");
        return "参数"+s;
    }

    @RequestMapping("/param2")
    @ResponseBody
    public String param2(String name, int age){
        return name+"年龄:"+age;
    }

    @RequestMapping("/param3")
    @ResponseBody
    public String param3(Emp emp){
        return emp.toString();
    }
}
